<span style="display: inline-block"><select class="form-control form_check text-more" <neq name="param.no_need_check" value="1">check-type="Select"</neq> name="{$param.mark}province" id="{$param.mark}J_province"></select></span>
<span style="display: inline-block"><select class="form-control form_check text-more" <neq name="param.no_need_check" value="1">check-type="Select"</neq> name="{$param.mark}city" id="{$param.mark}J_city" style="display:none;"></select></span>
<span style="display: inline-block"><select class="form-control form_check text-more the_last" check-type="Select" <eq name="param.can_empty" value="1">can-empty="1"</eq>  name="{$param.mark}district" id="{$param.mark}J_district" style="display:none;"></select></span>


<script type="text/javascript">



$(function(){
	var pid=<if condition="$param.province neq ''">{$param.province}<else />0</if>;  //默认省份id
	var cid=<if condition="$param.city neq ''">{$param.city}<else />0</if>;  //默认城市id
	var did=<if condition="$param.district neq ''">{$param.district}<else />0</if>;  //默认区县市id
    /*修复联动不及时的bug，陈一枭*/
function change_province(pid,flag){
        $.post("{:addons_url('ChinaCity://ChinaCity/getProvince')}", {pid: pid}, function(result){
            $("#{$param.mark}"+"J_province").html(result);
            if(flag != 1){
               $("#{$param.mark}"+"J_province").blur();
           }


        });
    }

function change_city(p_pid,p_cid,flag){
    $.post('{:addons_url("ChinaCity://ChinaCity/getCity")}', {pid: p_pid, cid: p_cid}, function(result){
        $("#{$param.mark}"+"J_city").show().html(result);
        if(flag != 1){
        $("#{$param.mark}"+"J_city").blur();
        }


    });
}
function change_district(p_cid,p_did,flag){
    $.post('{:addons_url("ChinaCity://ChinaCity/getDistrict")}', {cid: p_cid, did: p_did}, function(result){
        $("#{$param.mark}"+"J_district").show().html(result);
        if(flag != 1){
        $("#{$param.mark}"+"J_district").blur();
        }
    });
}

    change_province(pid,1);
    change_city(pid,cid,1);
    change_district(cid,did,1);


	$('#{$param.mark}'+'J_province').change(function(){
       // $("#{$param.mark}"+"J_city").parent().find('.glyphicon').remove()
        var pid_g=$(this).children('option:selected').val();
		change_city(pid_g)
        change_district(0);

	});

	$('#{$param.mark}'+'J_city').change(function(){
		var cid_g=$(this).children('option:selected').val();
		change_district(cid_g)


	});

	$('#{$param.mark}'+'J_district').change(function(){
		var did_g=$(this).children('option:selected').val();
	});

});
/*修复联动不及时的bug，陈一枭end*/
</script>